package JJJJJJava.loadandsave;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.sql.DataFrame;
import org.apache.spark.sql.SQLContext;

/**
 * @Auther: Mengkunxuan
 * @Date:2018/9/2610:41
 * @Description:
 */
public class GenericLoadSave {
    public static void main(String[] args) {
        SparkConf conf = new SparkConf().setMaster("lcoal").setAppName("GenericLoadSave");

        JavaSparkContext sc = new JavaSparkContext(conf);
        SQLContext sqlContext = new SQLContext(sc);

        DataFrame usersDF = sqlContext.read().load("C:/");
        usersDF.select("name","favorite_color").write().save("d:/");
    }
}
